package com.kono.controlller;

import com.kono.entity.PageResult;
import com.kono.pojo.Teach;
import com.kono.service.TeachService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/teach")
public class TeachController {

    @Autowired
    TeachService teachService;

    @RequestMapping("/findPage")
    public PageResult<Teach> findPage(@RequestBody Teach teach, Integer page, Integer size){
        PageResult<Teach> pageResult = teachService.findPage(teach, page, size);
        return pageResult;
    }

    @RequestMapping("/addTeach")
    public void add(@RequestBody Teach teach){
        System.out.println("-----------"+teach+"-------------");
        teachService.add(teach);

    }


}
